$(document).ready(function () {
    var list = $('#List');
    $('.xh-datagrid-toolbar').parseToolbar();
    $('.xh-form').parseForm($('#bt_form_add, #bt_form_edit'));

    /*初始化列表*/
    list.initDataGrid(moduleUrl + 'Service/getReports').setSelectThenEnable(['bt_list_del']);
    /**搜索**/
    $('#bt_list_search').click(function () {
        // var _search = {"keywords": $('#List_Search').getElementValue()};
        // console.log("搜索："+_search);
        var type=($('#list_item')).getElementValue()-1;
        var id=($('#search_item')).getElementValue();
        var userId=null;
        var deviceId=null;
        if(id!==''&&id!==null){
            if(id==="deviceId"){
                deviceId=($('#search_vague')).getElementValue();
            }
            if(id==="userId"){
                userId=($('#search_vague')).getElementValue();
            }
        }
        var _search={"type":type,"deviceId":deviceId,"userId":userId};
        list.addDataGridParams(_search);
    });
    //回车事件
    $('#List_toolbar').keydown(function () {
        if (event.keyCode == "13") {
            $('#bt_list_search').click();
        }
    });


});


